package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> flavorList(Long id);

    //新增口味，批量新增
    void saveBatch(List<DishFlavor> flavors);

    //删除口味
    void deleteFlavor(List<String> ids);

    //根据菜品id查询口味
    List<DishFlavor> getDishFavor(Long dishId);

    //根据id删除菜品口味
    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteFlavorId(Long dishId);
}
